package itheima05;

import java.util.stream.Stream;

/*
    Stream流中的静态方法
       public static <T> Stream<T> concat(Stream<T> a, Stream<T> b):
            把参数列表中的两个Stream流对象a和b,合并成一个新的Stream流对象


 */
public class Demo10Concat {
    public static void main(String[] args) {
        Stream<String> s1 = Stream.of("大娃", "二娃", "三娃", "四娃", "五娃", "六娃", "七娃");
        Stream<String> s2 = Stream.of("爷爷", "蛇精", "蝎子精");

        //把Stream流对象s1和s2合并到一起
        Stream<String> s = Stream.concat(s1, s2);

        //lambda表达式
        s.forEach((String name)->{
            System.out.println(name);
        });

    }
}
